package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121660770";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDe7syqfIOJ0zwGmxiS1548KNh7qcRhZoxwfOB3VSkNdBZqRGNchXrB7V4vj0ootMJEaQCjPmP7msFDutZL/GDh70Dt8pxcHrekXvS8eFMq7ac6fMy9TjDqdYi3ankc2wDtq2bA0fQLIArHCR2CdnDr89Clqa+EZFcm35B/kcQ6wgnOgjVld+Ju3LeRD5jQm8vLCgK5EGQT1GfszoDdde4W12Vc6bA8mqie3kzfnaTThV+NScIm97QZg28mL0/YFs3fxeVsN0A7fF2P31+S8hxsYtt7myd0g5wVpUhUmZrCl+zhGi6cbFuIdKRVMSuPccgtvcXvQLIwFGHaGzskAyVzAgMBAAECggEAbLL9QkeSD5raktH+6mKN+gFkhO+jHGbXJWYOQMFaUf//ifMsi4ld8L7fhMsWOsDgVGDqea5LK/wqLe8k3EoDp0Z0X1FDYjtsCY5vQJJe4vib6I2/erJscXW7osscoLA8RKalZHE60E3gU2ojZGCB8NqiKpSRSzltsTujBkC58HeQxvcyEKNYrbFaLUue+HlJarVMyV3ESoUDJVwUNCqdJ33Z72teQtpAJNAl4/J3IlbqTweAiuoe/N+ZLVbl7Kuj5sCMM6bIliKWUvr0t77ArxvK8ThaIGY369H94TkpEMg22rj89tspmM+nWQkoiWYbB5Bya4Gtx03yKvpEdarFaQKBgQD+hrbrC7emrS8qpGv0ZjR7of9eUBChY2wRz60KqO0vCwTfcejRFL0BL/6YEZFMWOq8yLf8juZFiObZyrjwWv9u9edcq68sXZPJx+7wPKNr8WIjus8u8sGqNJ/pMlmkNCvQ/QBC+AvSLWm/lYTWaqJwrt0AJk8S6prQD/8ipzGdZwKBgQDgOUD94FpX9sKlK1ZGe5f7gVwrPg/wIG9G3YkVPCFbusvezw7ECzixr9/7JJ14E7DgvlJ4YtgMSGCcVej0vfIrfHCWg4q6OK7Jz/z/vhsHf/1w1lg+xpJU0VwSaosO83tv+k9LRhl5FcBIih8vfpAhJE6NFOG/4qh6zDqv6sNkFQKBgDJFSTuDRPKWogo6D1hmF1eT12w5RA+cI2whKHxCgRYZhwza4rDo96uUXySJ07jQlwxSWIR5dOGm+HFrqLtQPcMcrmWPQznwAZCI/JhWYbCgLFICQ4lySO3lFvBoEWxtIXpVfge8Fhmc/pXoYiQ3S34WC3BMILILxCf0AOBHRXVhAoGBALAKg4pPoN67MCr5kW0ZEEQ4ViLlQSIodPVQbZYsdYxNZk7yhgdJQCPRj6rgHnnuC8sH4jv+bt2F3cQgdxvgHcgilUq20C5Q3no4P8ySdyo2RMdYokP3J2BMV1tmJvOAGoPaJHNXABzfBO5u8vkZBxPeK4X8xRkgXWK8Ab+oM+vZAoGALGxrUfWWBT9G39h9hMybY5xBkX9f2hzB/5yquDY+aqfRgca2uhMyqT267fvOwguBnXrKyWw1+w12weJsFn46CFpbuhGZmeINph9a9g0E2HKVDlB88C+QzU3qh7/O2mzee3RoeLkDUEdtlvlm3xp0+yo1umg4/crG2l9rLUd5V4w=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAniS/gaDCKcgJPMvCLQ9dhW0S6FuJwRQs2c1ArUGBgpTat+Zj3jH1kTM/k+FLKrJJj/JnE+0cFcp18D8Y+EKrPdMxVly8qvQzmej75hjqWtH3znakhwFn3FAPgJNXQxxKkB2+4oOh2G2kLzjTNACQei1odv+SCTSGXS57xF7hd5FL9d7Z6RLx+UsxVtkXvh9wjWFTsJJnySqRHWNZYii9cCB2gqHg2FW18HT1Zu4d7OK1CmkdJn6pkZAQn+vcbVgJVCto7pm3i6WlMLyHOFrh/kFz7TNH4cF3WAUv6QVyvOVo7C39WMDZAX3undB6OUM4jHCVEZShY7Q/j2rf7Z2SOwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://592562o7c1.zicp.fun/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://592562o7c1.zicp.fun/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

